<h1>Add Resource</h1>
 <% if flash[:notice] %>
    <div class="notice"><%= flash[:notice] %></div>
  <% end %>

<%= link_to "Back", :controller => "hello", :action => "index" %> 
<p>
<%= form_for @resource, :url => { :action => "createresource" } do |f| %>
  <% if @resource.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@resource.errors.count, "error") %> prohibited this event from being saved:</h2>

      <ul>
      <% @resource.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label "Resource Name:" %><br />
    <%= f.text_field :name %>
  </div> 
  
  <div class="field">
    <%= f.label :description %><br />
    <%= f.text_area :description %>
  </div>
  
  <div class="field">
	 <%= f.label "Resource group" %><br />
    <select name="resource[resourcegroup_id]">
	<option value="">Select Resource Group</option>
	<% @resourcegroup_data.each do |t| %>
		<option value="<%= t.id %>"><%= t.name %></option>
	<% end %>
    </select>
  </div>
  
  
  <div class="field">
    <%= f.label "Color:" %><br />
    <%= f.text_field :color %>
  </div>  
  
    <div class="field">
    <%= f.label "Text color:" %><br />
    <%= f.text_field :textcolor %>
  </div>  
  
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>